<?php if (!defined('THINK_PATH')) exit(); /*a:2:{s:61:"D:\phpstudy_pro\WWW\hsycmsv1/app/hsycms\view\article\adv.html";i:1535091133;s:60:"D:\phpstudy_pro\WWW\hsycmsv1\app\hsycms\view\index\head.html";i:1533175385;}*/ ?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>HSYCMS后台管理系统</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<link rel="stylesheet" href="/public/layui/css/layui.css?v=<?php echo time(); ?>" />
<link rel="stylesheet" type="text/css" href="/public/admin/css/touchTouch.css?v=<?php echo time(); ?>">
<link rel="stylesheet" href="/public/admin/css/admin.css?v=<?php echo time(); ?>" />
<script src="/public/admin/js/jquery.js?v=<?php echo time(); ?>"></script>
<script src='/public/tinymce/tinymce.min.js'></script>
<script src="/public/admin/js/validform5.3.2min.js"></script>
<script src="/public/layer//layer.js?v=<?php echo time(); ?>"></script>
<script src="/public/layui/layui.js?v=<?php echo time(); ?>"></script>
<script src="/public/admin/js/touchTouch.jquery.js"></script> 
<script src="/public/admin/js/admin.js?v=<?php echo time(); ?>"></script>
</head>
<body>

<div class="box">
  <?php if($act == 'edit'): ?>
  <div class="form" style="border:1px solid #eee; margin-top:25px; padding-top:0px;">
    <div class="ht" style="border-bottom:1px solid #eee; padding:12px; margin-bottom:25px; color:#909ba5; background:#f5f8fb;"><?php echo $name; ?>添加</div>
    <form method="post" action="<?php echo url('add'); ?>" class="sycmsform">
      <input type="hidden" name="id" value="<?php echo $v['id']; ?>" />
      <input type="hidden" name="nid" value="<?php echo $nid; ?>" />
      <input type="hidden" name="mid" value="<?php echo $mid; ?>" />
      <ul class="tabcon" style="display:block;">
        <li>
          <label>标题：</label>
          <div class="item">
            <input type="text" name="title" class="input" value="<?php echo $v['title']; ?>" datatype="*" nullmsg="请输入标题"/>
          </div>
        </li>
         <li>
          <label>图片：</label>
          <div class="item"> 
            <input type="text" name="img" class="input" value="<?php echo $v['img']; ?>"/>
            <button type="button" class="button fl" onclick="sycms.showupload(this)" id="image1" at="dg"><i class="icon-plus"></i>上传图片</button>
            <span class="tips"><?php echo $imgtips; ?></span>
            <div class="clear"></div>
            <div class="input-image"><?php if($v['img']): ?><img src="<?php echo $v['img']; ?>" alt="" /><?php endif; ?></div>         
          </div>
        </li>
        <?php if($nid != 85): ?>
        <li>
          <label>连接地址:</label>
          <div class="item">
            <input type="text" class="input w60" name="url" value="<?php echo $v['url']; ?>" />
          </div>
        </li>
        <?php endif; ?>
       <li>
          <label>排序：</label>
          <div class="item">
            <input type="text" name="sort" value="<?php echo $v['sort']; ?>" ignore=ignore datatype="n" errormsg="只能输入数字" class="input" />
          </div>
        </li>
      </ul>
      <ul>
        <li>
          <label>&nbsp;</label>
          <div class="item">
            <button type="submit" class="button"><i class="icon-check"></i>编辑</button> <button type="button" onclick="javascript:history.go(-1);" class="button"><i class="icon-mail-reply (alias)"></i>返回</button>
          </div>
        </li>
      </ul>
    </form>
  </div>
  <?php else: ?>
  <div class="box-head">
    <h2><?php echo $name; ?>列表</h2>
    <div class="fr">
      &nbsp;<a href="javascript:history.go(-1);" class="btn fr"><i class="icon-mail-reply (alias)"></i>返回</a></div>
  </div>
  <table class="table">
    <tr>
      <th width="100">ID</th>
      <th width="20%">标题</th>
      <th width="20%">图片</th>
      <th width="30%">URL</th>
      <th>排序</th>
      <th width="200">操作</th>
    </tr>
    <?php if(is_array($list) || $list instanceof \think\Collection || $list instanceof \think\Paginator): $i = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?>
    <tr>
      <td><?php echo $v['id']; ?></td>
      <td><?php echo $v['title']; ?></td>
      <td><img src="<?php echo $v['img']; ?>" alt="" style="max-width:200px; max-height:50px;" /></td>
      <td><?php echo $v['url']; ?></td>
      <td><input type="text" class="sorttext" value="<?php echo $v['sort']; ?>"  onkeyup="(this.v=function(){this.value=this.value.replace(/[^0-9-]+/,'');}).call(this)" 
        onblur="sycms.sorts('<?php echo url('sorts'); ?>',<?php echo $v['id']; ?>,this.value);" /></td>
      <td><a href="<?php echo url('adv',['id'=>$v['id'],'nid'=>$nid,'act'=>'edit']); ?>" class="btn"><i class="icon-edit"></i> 编辑</a> <a href="javascript:void(0);" onclick="sycms.del('<?php echo url('del',['id'=>$v['id']]); ?>')" class="btn red"><i class="icon-trash-o"></i> 删除</a></td>
    </tr>
    <?php endforeach; endif; else: echo "" ;endif; ?>
    <tr>
    <td colspan="6"><div class="page"><?php echo $page; ?></div></td>
    </tr>
  </table>  
  <div class="form" style="border:1px solid #eee; margin-top:25px; padding-top:0px;">
    <div class="ht" style="border-bottom:1px solid #eee; padding:12px; margin-bottom:25px; color:#909ba5; background:#f5f8fb;"><?php echo $name; ?>添加</div>
    <form method="post" action="<?php echo url('add'); ?>" class="sycmsform">
      <input type="hidden" name="nid" value="<?php echo $nid; ?>" />
      <input type="hidden" name="act" value="<?php echo $act; ?>" />
      <input type="hidden" name="mid" value="<?php echo $mid; ?>" />
      <ul class="tabcon" style="display:block;">
        <li>
          <label>标题：</label>
          <div class="item">
            <input type="text" name="title" class="input" datatype="*" nullmsg="请输入标题"/>
          </div>
        </li>
         <li>
          <label>图片：</label>
          <div class="item">
            <input type="text" name="img" class="input" datatype="*" nullmsg="请上传图片"/>
            <button type="button" class="button fl" onclick="sycms.showupload(this)" id="image1" at="dg"><i class="icon-plus"></i>上传图片</button>
            <span class="tips"><?php echo $imgtips; ?></span> 
          </div>
        </li>
        <?php if($nid != 85): ?>
        <li>
          <label>连接地址:</label>
          <div class="item">
            <input type="text" class="input w60" name="url" />
          </div>
        </li>
        <?php endif; ?>
       <li>
          <label>排序：</label>
          <div class="item">
            <input type="text" name="sort" value="0" ignore=ignore datatype="n" errormsg="只能输入数字" class="input" />
          </div>
        </li>
      </ul>
      <ul>
        <li>
          <label>&nbsp;</label>
          <div class="item">
            <button type="submit" class="button"><i class="icon-check"></i>添加</button>
          </div>
        </li>
      </ul>
    </form>
  </div>  
  <?php endif; ?>
</div>
<script> 
sycms.submitform("<?php echo url('adv',['nid'=>$nid]); ?>"); 
</script>